<?php
/**
 *
 * @time 2022-7-25
 * @uthor 王恒兵
 */
// 初始化一个客户端实例
use Cal\Client\Client;
use Grpc\ChannelCredentials;
use Test\CalRequest;

require dirname(dirname(__FILE__)) . '/vendor/autoload.php';

$client = new Client("localhost:50052", [
    'credentials' => ChannelCredentials::createInsecure(),
]);

$request = new \Cal\CalRequest();
$request->setParameter1(80);
$request->setParameter2(20);

list($response, $status) = $client->Add($request)->wait();

var_dump($status);
var_dump($response->getRes());